<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<h2 id="page-heading">Aggiunta di un nuovo utente</h2>

<br/>

<form:form commandName="utente">
	<form:hidden path="ID"/>
	<table>
		<tr>
			<td width="20%">Nome</td>
			<td width="20%"><form:input path="nome" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="nome" cssClass="errorMessage"/></td>
		</tr>
		<tr>
			<td>Cognome</td>
			<td><form:input path="cognome" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="cognome" cssClass="errorMessage"/></td>
		</tr>
		<tr>
			<td>Codice fiscale</td>
			<td><form:input path="codiceFiscale" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="codiceFiscale" cssClass="errorMessage"/></td>
		</tr>
		<tr>
			<td>Partita Iva</td>
			<td><form:input path="partita_iva" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="partita_iva" cssClass="errorMessage"/></td>
		</tr>
		<tr>
			<td>Username</td>
			<td><form:input path="login" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="login" cssClass="errorMessage"/></td>
		</tr>
		<tr>
			<td>Password</td>
			<td><form:input path="password" cssClass="lowRow" size="30" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="password" cssClass="errorMessage"/></td>
		</tr>	
		<tr>
			<td>Titolo di Studio</td>
			<td>
			<form:select path="id_titolo_studio">
			<c:forEach items="${Titoli}" var="titolo">			
			<form:option value="${titolo.ID}" cssClass="lowRow"  cssErrorClass="errorsBorder">${titolo.descrizione}
			</form:option>
			<form:errors path="id_titolo_studio" cssClass="errorMessage"/>
			</c:forEach>
			</form:select>
			</td>
		</tr>	
		<tr>
		<td>Profilo</td>
		<td>
			<form:select path="id_profilo">
			<c:forEach items="${Profili}" var="profilo">			
			<form:option value="${profilo.ID}" cssClass="lowRow"  cssErrorClass="errorsBorder">${profilo.descrizione}
			</form:option>
			<form:errors path="id_profilo" cssClass="errorMessage"/>
			</c:forEach>
			</form:select>
			</td>
		</tr>	
		<tr>
			<td>Attivo</td>
			<td><form:checkbox path="attivo" cssClass="lowRow" cssErrorClass="errorsBorder"/></td>
		    <td><form:errors path="attivo" cssClass="errorMessage"/></td>
		</tr>
		<tr align="center">
			<td colspan="3">
				<hr />
			</td>
		</tr>
		<tr align="center">
			<td colspan="3" align="center">
			<table width="1px;">
				<tr>
					<td>
						<div class="buttons" onmouseover="Tip('Salva l\'utente');" align="center">
						    <button type="submit" class="">
						        <img src="<c:url value="/images/button-save.png"/>" alt=""/>
						        SALVA UTENTE
						    </button>
						</div>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<tr align="center">
			<td colspan="3">
				<br />
			</td>
		</tr>

	</table>
</form:form>
